package com.aistar.repository;

import com.aistar.pojo.Comment;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Component;


import java.util.List;

@Component
public interface CommentRepository extends MongoRepository<Comment,Integer> {
    //暂时没用到
    public List<Comment> findByProductId(Integer productId);
    public List<Comment> findByCustomerId(Integer customerId);

    public Page<Comment> findByProductId(Integer productId, Pageable pageable);

    public Page<Comment> findAllByProductIdAndCommentStatus(Integer productId,Integer status, Pageable pageable);
    public Page<Comment> findByCustomerId(Integer customerId, Pageable pageable);
}
